package com.ewanghuiju.app.ui.shopmail.activity;

import android.graphics.drawable.GradientDrawable;
import android.view.View;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.ewanghuiju.app.R;
import com.ewanghuiju.app.base.SimpleActivity;
import com.ewanghuiju.app.util.AutoSoftUtils;
import com.ewanghuiju.app.util.nodoubleclick.AntiShake;
import com.ewanghuiju.app.widget.EditTextWithDel;
import com.gyf.immersionbar.ImmersionBar;

import butterknife.BindView;
import butterknife.OnClick;

/**
 * @author sj  qq:751943509
 * @class 找回订单
 * @time 2020/2/24
 */
public class FoundOrderActivity extends SimpleActivity {

    @BindView(R.id.toolbar)
    RelativeLayout toolbar;
    @BindView(R.id.et_order)
    EditTextWithDel etOrder;
    @BindView(R.id.tv_found)
    TextView tvFound;
    @BindView(R.id.layout_search)
    RelativeLayout layoutSearch;

    @Override
    protected int getLayout() {
        return R.layout.activity_found_order;
    }

    @Override
    protected void initEventAndData() {
        GradientDrawable gradientDrawable = (GradientDrawable) tvFound.getBackground();
        gradientDrawable.setCornerRadii(new float[]{0, 0, 50, 50, 50, 50, 0,
                0});

        GradientDrawable layoutSearchGd = (GradientDrawable) layoutSearch.getBackground();
        layoutSearchGd.setCornerRadius(50);

//        etOrder.setHintTextColor(ContextCompat.getColor(mContext, R.color.colorPrimary));
//        etOrder.setTextColor(ContextCompat.getColor(mContext, R.color.colorPrimary));
//        etOrder.setCompoundDrawables(ContextCompat.getDrawable(mContext, R.mipmap.search_primary),null,null,null);

    }

    @OnClick({R.id.iv_back,R.id.layout_et})
    public void doClick(View view) {
        if (AntiShake.check(view.getId())) {    //判断是否多次点击
            return;
        }
        switch (view.getId()) {
            case R.id.iv_back:
                finish();
                break;
            case R.id.layout_et:
                AutoSoftUtils.showSoftInput(etOrder);
                break;
            default:
                break;
        }
    }

    @Override
    protected void initImmersionBar() {
        super.initImmersionBar();
        ImmersionBar.with(this)
                .titleBar(toolbar, true)
                .transparentBar()
                .statusBarDarkFont(true)
                .navigationBarDarkIcon(true)
                .init();
    }
}
